package com.e3mall.cotroller;

import com.e3mall.pojo.TbItem;
import com.e3mall.service.ItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/item")
public class ItemController {

    @Autowired
    private ItemService itemService;


    @RequestMapping("/findItemById.do")
    @ResponseBody
    //根据id查询订单
    public TbItem findItemById(Long id) {
        TbItem tbItem = null;
        try {
            tbItem = itemService.findItemById(id);
        }catch (Exception e){
            e.printStackTrace();
        }
        return tbItem;
    }




}
